package com.gpj.sgz.init.skill;

import com.gpj.sgz.init.base.General;
import com.gpj.sgz.init.base.Skill;
import com.gpj.sgz.system.BattleGround;
import com.gpj.sgz.untils.Constants;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * @className Attche
 * @description TODO
 * @author GPJ
 * @date 2020/9/27 17:22
 * @version 1.0
 **/
@Slf4j
public class Attack extends Skill {
    public Attack() {
        super("普通攻击", 100, null);
    }

    @Override
    public void handle(General sourceGeneral, General targetGeneral, BattleGround ground) {
        int result = ((int)(sourceGeneral.getForce() - targetGeneral.getDefense()) / 150 + 1) * (sourceGeneral.getArms() / 20) * 1 * 1;
        result = targetGeneral.getArms() > result?result:targetGeneral.getArms();
        log.info("{}[{}]对[{}]发动了【普通攻击】", Constants.LOG_TAB, sourceGeneral.getName(), targetGeneral.getName());
        log.info("{}{}[{}]受到攻击，造成兵力损失({})", Constants.LOG_TAB, Constants.LOG_TAB, targetGeneral.getName(), result);
    }
}